﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SimpleUnitity.Cache
{
    [Serializable]
    public class WarpCache : ICache
    {
        private readonly ICache cache;
        public WarpCache(ICache cache)
        {
            this.cache = cache;
        }

        public virtual void Clear()
        {
            cache.Clear();
        }

        public virtual bool Exists(string key)
        {
            return cache.Exists(key);
        }

        public virtual void Set(string key, object value)
        {
            cache.Set(key, value);
        }

        public virtual object Get(string key, object defaultValue = null)
        {
            return cache.Get(key, defaultValue);
        }

        public virtual void Remove(string key)
        {
            cache.Remove(key);
        }

        public virtual ICollection<string> Keys
        {
            get { return cache.Keys; }
        }
    }
}
